﻿<%@ Page Language="C#"  MasterPageFile="~/Profile/ProfileHR.master" AutoEventWireup="true" CodeBehind="MyAccount.aspx.cs" Inherits="HRdex_Final.Profile.MyAccount" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="account" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>   
    <div>
     <asp:Label ID="Label2" runat="server" Text="My Account" 
                    Font-Bold="True" Font-Size="Larger" ForeColor="#0066FF"></asp:Label><br />
    <table style="background-color: #FFFFFF; ">
        <tr>
            <td>&nbsp;</td>
            <td><asp:Label ID="lblName" runat="server" Text="Label" Width="358px" Height="28px"></asp:Label></td>
        </tr>
    </table>
    <table style="background-color: #FFFFFF; border-style: double; border-color: #0066FF">
        <tr>
            <td class="style1">
                Username<br />
                <asp:TextBox ID="txtUName" runat="server" Width="300" Enabled="False" 
                    ReadOnly="True"></asp:TextBox> 
            </td>
        </tr>

        <tr>
            <td class="style1">
                Password<br />
                <asp:TextBox ID="txtpw" runat="server" Width="300" TextMode="Password"></asp:TextBox> 
            </td>
        </tr>
        
        <tr>
            <td class="style1">
                Verify Password<br />
                <asp:TextBox ID="txtpwV" runat="server" Width="300" TextMode="Password"></asp:TextBox> 
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ControlToCompare="txtpw" ControlToValidate="txtpwV" 
                    ErrorMessage="Password did not match" ForeColor="Red"></asp:CompareValidator>
            </td>
        </tr>

        <tr>
            <td class="style1">
                Name<br />
                <asp:TextBox ID="txtName" runat="server" Width="300" Enabled="False" 
                    ReadOnly="True"></asp:TextBox> 
            </td>
        </tr>

        <tr>
            <td class="style1">
            <br />
                <asp:Label ID="Label1" runat="server" Text="Contact Information" 
                    Font-Bold="True" Font-Size="Larger" ForeColor="#0066FF"></asp:Label><br />
                <hr style="width:300"/>
            </td>
        </tr>

        <tr>
            <td class="style1" style="height: 42px">
                Email Address<br />
                <asp:TextBox ID="txtemail" runat="server" Width="300"></asp:TextBox> 
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtemail" ErrorMessage="Invalid Email" ForeColor="Red" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
                    <tr>
            <td class="style1" style="height: 42px">
                Contact No<br />
                <asp:TextBox ID="txtnum" runat="server" Width="300"></asp:TextBox> 
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtemail" ErrorMessage="Invalid Email" ForeColor="Red" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
                    <tr>
                        <td class="style1">
                            <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Larger" 
                                ForeColor="#0066FF" Text="CBA"></asp:Label>
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                                DataSourceID="wo" DataKeyNames="CBAmonID">
                                <Columns>
<asp:TemplateField>
            <ItemTemplate>
                <asp:HyperLink ID="lnkSelect" runat="server" 
                    NavigateUrl='<%# String.Format("~/Forms/CBAmonitoring.aspx?CBAmonID={0}", Eval("CBAmonID")) %>'>Select</asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
                                    <asp:BoundField DataField="CBAmonID" HeaderText="CBAmonID" 
                                        SortExpression="CBAmonID" InsertVisible="False" ReadOnly="True" />
                                    <asp:BoundField DataField="StudentNo" HeaderText="StudentNo" 
                                        SortExpression="StudentNo" />
                                    <asp:BoundField DataField="Name" HeaderText="Name" 
                                        SortExpression="Name" ReadOnly="True" />
                                        <asp:BoundField DataField="CourseName" HeaderText="CourseName" 
                                            SortExpression="CourseName" />
                                        <asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year" />
                                </Columns>
                            </asp:GridView>
                            <asp:SqlDataSource ID="wo" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
                                
                                
                                
                                SelectCommand="SELECT CBAmon.CBAmonID, CBAmon.StudentNo, CBAmon.StudentFirstName + ' ' + CBAmon.StudentLastName AS Name, catCourse.CourseName, catYear.Year FROM CBAmon INNER JOIN catCourse ON CBAmon.CourseID = catCourse.CourseID INNER JOIN catYear ON CBAmon.YearID = catYear.YearID">
                            </asp:SqlDataSource>
                            <br />
                        </td>
                    </tr>
        </tr>

        <tr>
            <td class="style1">
                <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
            </td>
        </tr>
    </table>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
         ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
         SelectCommand="SELECT * FROM [formEmployees]"></asp:SqlDataSource>
     </div>
</asp:Content>